ci: buffer fuzz timeout above max_total_time so libFuzzer self-exits#40
Conversation
|
Too many files changed? Review this PR in Change Stack to see how the pieces fit before you dive in. WalkthroughUpdated security workflow timeout handling for libFuzzer fuzzing jobs. Quick Fuzz outer timeout increased from 120 to 150 seconds, Deep Fuzz from 28800 to 28980 seconds, both preserving their inner ChangesFuzzing workflow timeout tuning
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
The outer `timeout` wrapping `cargo fuzz run` must exceed -max_total_time. libFuzzer's clock starts after build + corpus-load, so an equal timeout always wins the race and SIGTERMs the process before its graceful "Done" self-exit — every run then logs "run interrupted", making a genuine hang indistinguishable from normal end-of-budget completion. - Quick Fuzz: timeout 120 -> 150 (max_total_time stays 120, +30s slack) - Deep Fuzzing: timeout 28800 -> 28980 (max_total_time stays 28800, +3min slack, within 540min job cap) Exit code 124 (genuine hang killed by timeout) remains tolerated.
cab6ba3 to
81b82ad
Compare
|
@coderabbitai approve |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/security.yml:
- Around line 190-197: The shell command using the GitHub Actions template
expansion `${{ matrix.target }}` should be quoted to prevent word-splitting or
injection if the matrix values change; update the timeout/cargo fuzz invocation
(the line calling `timeout 28980 cargo fuzz run ${{ matrix.target }} --
-max_total_time=28800 || [ $? -eq 124 ]`) to wrap the template expansion in
quotes (e.g., use `"$...` around `${{ matrix.target }}`) so the matrix target is
passed as a single argument to `cargo fuzz run`.
- Around line 127-132: Update the shell command that runs fuzzing to quote the
matrix expansion to avoid word-splitting or injection: change the invocation
"timeout 150 cargo fuzz run ${{ matrix.target }} -- -runs=0 -max_total_time=120
|| [ $? -eq 124 ]" so the template expansion is wrapped in double quotes (e.g.
"${{ matrix.target }}"), leaving the rest of the command and the timeout/error
handling unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 68e3bb38-839b-4824-a55b-960bb1548cda
📒 Files selected for processing (1)
.github/workflows/security.yml
✅ Action performedComments resolved and changes approved. |
What
Widen the outer
timeoutwrappingcargo fuzz runin both the Quick Fuzz and Deep Fuzzing jobs so it sits above libFuzzer's-max_total_time, not equal to it.timeout-max_total_timeWhy
libFuzzer self-exits gracefully at
-max_total_timewith a finalDone N runs+ corpus consolidation. Its clock starts after build + corpus-load, so an equal outertimeoutalways wins the race — it SIGTERMs the process first, every run logsrun interrupted, and a genuine hang becomes indistinguishable from normal end-of-budget completion. The buffer makestimeouta hang safety-net only.Exit code 124 (timeout fired = real hang) remains tolerated.
Notes
ci:type — non-releasing, does not trigger release-please.Summary by CodeRabbit